package com.dyp.configurationpropertiesdemo;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class SecondConfiguration {

    @ConfigurationProperties(prefix = "dyp.second")
    @Bean(name = "secondConfig")
    public SecondConfig readDruidDataSource() {
        SecondConfig secondConfig = new SecondConfig();
        secondConfig.setCity("xian");
        secondConfig.setAge(16);
        return secondConfig;
    }
}
